﻿using System;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using LiveCharts;
using LiveCharts.Wpf;

internal class ShapesStroke
{
 
	public PathFigure PathFigure_0 { get; set; }

 
	public Path Path_0 { get; set; }

 
	public bool Boolean_0 { get; set; }

	public void method_0(Brush brush_0, Brush brush_1, Series series_0)
	{
		if (this.PathFigure_0 != null && series_0.Values != null)
		{
			ChartPoint chartPoint = series_0.ActualValues.GetPoints(series_0).FirstOrDefault<ChartPoint>() ?? new ChartPoint();
			double x = ChartFunctions.ToDrawMargin(chartPoint.X, AxisOrientation.X, series_0.Model.Chart, series_0.ScalesXAt);
			double y = ChartFunctions.ToDrawMargin(chartPoint.Y, AxisOrientation.Y, series_0.Model.Chart, series_0.ScalesYAt);
			if (series_0.Model.Chart.View.DisableAnimations)
			{
				this.PathFigure_0.StartPoint = new Point(x, y);
			}
			else
			{
				this.PathFigure_0.BeginAnimation(PathFigure.StartPointProperty, new PointAnimation(new Point(x, y), series_0.Model.Chart.View.AnimationsSpeed));
			}
		}
		if (this.Boolean_0)
		{
			series_0.Model.Chart.View.EnsureElementBelongsToCurrentDrawMargin(this.Path_0);
			this.Path_0.Stroke = brush_1;
			this.Path_0.StrokeThickness = series_0.StrokeThickness;
			this.Path_0.Fill = brush_0;
			this.Path_0.Visibility = series_0.Visibility;
			this.Path_0.StrokeDashArray = series_0.StrokeDashArray;
			Panel.SetZIndex(this.Path_0, Panel.GetZIndex(series_0));
			this.Boolean_0 = true;
			return;
		}
		this.Path_0 = new Path
		{
			Stroke = brush_1,
			StrokeThickness = series_0.StrokeThickness,
			Fill = brush_0,
			Visibility = series_0.Visibility,
			StrokeDashArray = series_0.StrokeDashArray
		};
		Panel.SetZIndex(this.Path_0, Panel.GetZIndex(series_0));
		PathGeometry pathGeometry = new PathGeometry
		{
			FillRule = FillRule.Nonzero
		};
		this.PathFigure_0 = new PathFigure();
		pathGeometry.Figures.Add(this.PathFigure_0);
		this.Path_0.Data = pathGeometry;
		series_0.Model.Chart.View.EnsureElementBelongsToCurrentDrawMargin(this.Path_0);
		ChartPoint chartPoint2 = series_0.ActualValues.GetPoints(series_0).FirstOrDefault<ChartPoint>() ?? new ChartPoint();
		double x2 = ChartFunctions.ToDrawMargin(chartPoint2.X, AxisOrientation.X, series_0.Model.Chart, series_0.ScalesXAt);
		double y2 = ChartFunctions.ToDrawMargin(chartPoint2.Y, AxisOrientation.Y, series_0.Model.Chart, series_0.ScalesYAt);
		this.PathFigure_0.StartPoint = new Point(x2, y2);
		this.Boolean_0 = true;
	}

	 
}
